﻿    //<![CDATA[
    $(document).ready(function() {
        function ActivateSlideShow() {
            $('#MySlideshow').slideshow({
                width: 640,     // width in px
                height: 480,    // height in px
                index: 0,       // start from frame number N
                time: 2000,     // time out beetwen (ms)
                title: false,     // show title
                titleshow: false, // always show title
                callback: SlideSowCallBack,  // callback function - call when slide changed - receive index and label
                panel: true,    // show controls panel
                loop: false,    // stop looping

                effect: 'fade',      // aviable fade, scrollUp/Down/Left/Right, zoom, zoomFade, zoomTL, zoomBR, growX, growY, random
                effecttime: 'slow',      // aviable fast,slow,normal and any valid fx speed value
                nextclick: true,       // bind content click next slide
                playframe: true,       // show frame "Play Now!"
                imgresize: true,       // resize image to slideshow window
                filter: false,    // remove <br/>, empty <div>, <p> and other stuff
                playclick: true,      // bind content click play/stop
                playhover: false,      // bind content hover play/stop
                playhoverr: false,     // bind content hover stop/play (reverse of playhover)
                help: '',

                controls: {         // show/hide controls elements
                    'hide': false,   // show controls bar on mouse hover
                    'first': true,  // goto first frame
                    'prev': true,   // goto previouse frame (if it first go to last)
                    'play': true,    // play slideshow
                    'next': true,   // goto next frame (if it last go to first)
                    'last': true,   // goto last frame
                    'help': false,   // show help message
                    'counter': true  // show slide counter
                }
            });
        }
        function showSlideShow() {
            $("#listslideshow").text("List View");
            $("#MySlideshow").show();
            $("#gallery").hide();
            $(".pagerbg").hide();
            $(".details").show();
        }
        function showLightBox() {
            $("#MySlideshow").hide();
            $("#gallery").show();
            $(".pagerbg").show();
            $("#listslideshow").text("Slide Show");
            $(".details").hide();
        }

        // activate light box
        $('#gallery a').lightBox();
        var slideshowattached = false;
        $("#viewSlideShow").click(function() {
            slideflag = false;
            if ($("#listslideshow").text() == "Slide Show") {
                showSlideShow();
                if (slideshowattached == false) {
                    slideshowattached = true;
                    ActivateSlideShow();
                }
            }
            else {
                slideflag = true;
                showLightBox();
            }
        });

    });
    var slideflag = false;
    function SlideSowCallBack(i, txt) {
        if (slideflag == false) {
            $(".details").show();
            $(".details").html(txt);
        }
    }
    //]]>

